package com.apps.diet.domain;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

@XmlRootElement(name = "meals")
@Entity
@Table(name="Meals")
public class Meals {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="MealId")
	int mealId;
	
	@Column(name="MealName")
	String mealName;

	@Column(name="MealTypeId")
	int mealTypeId;
	
	@Column(name="TotalCarbsFact")
	String totalCarbsFact;
	
	@Column(name="TotalProteinFact")
	String totalProteinFact;
	
	@Column(name="TotalFatFact")
	String totalFatFact;
	
	@Column(name="Modify_by")
	String modifyBy;
	
	@Column(name="Modify_dt")
	Date modifyDt;
	
	@OneToMany(mappedBy="meals", fetch=FetchType.EAGER)
	@Cascade(value = { CascadeType.ALL })
	@Fetch(FetchMode.SUBSELECT)
	List<MealNutriFactXref> mealNutriFactXrefList;

	public int getMealId() {
		return mealId;
	}

	public void setMealId(int mealId) {
		this.mealId = mealId;
	}

	public String getMealName() {
		return mealName;
	}

	public void setMealName(String mealName) {
		this.mealName = mealName;
	}

	public int getMealTypeId() {
		return mealTypeId;
	}

	public void setMealTypeId(int mealTypeId) {
		this.mealTypeId = mealTypeId;
	}

	public String getTotalCarbsFact() {
		return totalCarbsFact;
	}

	public void setTotalCarbsFact(String totalCarbsFact) {
		this.totalCarbsFact = totalCarbsFact;
	}

	public String getTotalProteinFact() {
		return totalProteinFact;
	}

	public void setTotalProteinFact(String totalProteinFact) {
		this.totalProteinFact = totalProteinFact;
	}

	public String getTotalFatFact() {
		return totalFatFact;
	}

	public void setTotalFatFact(String totalFatFact) {
		this.totalFatFact = totalFatFact;
	}

	public String getModifyBy() {
		return modifyBy;
	}

	public void setModifyBy(String modifyBy) {
		this.modifyBy = modifyBy;
	}

	public Date getModifyDt() {
		return modifyDt;
	}

	public void setModifyDt(Date modifyDt) {
		this.modifyDt = modifyDt;
	}

	public List<MealNutriFactXref> getMealNutriFactXrefList() {
		return mealNutriFactXrefList;
	}

	public void setMealNutriFactXrefList(List<MealNutriFactXref> mealNutriFactXrefList) {
		this.mealNutriFactXrefList = mealNutriFactXrefList;
	}
}
